1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.glib.gspawn; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import derelict.glib.gquark; 34 import derelict.glib.gerror; 35 36 import core.stdc.config; 37 38 extern (C): 39 40 alias _Anonymous_0 GSpawnError; 41 alias void function (void*) GSpawnChildSetupFunc; 42 alias _Anonymous_1 GSpawnFlags; 43 44 enum _Anonymous_0 45 { 46 G_SPAWN_ERROR_FORK = 0, 47 G_SPAWN_ERROR_READ = 1, 48 G_SPAWN_ERROR_CHDIR = 2, 49 G_SPAWN_ERROR_ACCES = 3, 50 G_SPAWN_ERROR_PERM = 4, 51 G_SPAWN_ERROR_TOO_BIG = 5, 52 G_SPAWN_ERROR_2BIG = 5, 53 G_SPAWN_ERROR_NOEXEC = 6, 54 G_SPAWN_ERROR_NAMETOOLONG = 7, 55 G_SPAWN_ERROR_NOENT = 8, 56 G_SPAWN_ERROR_NOMEM = 9, 57 G_SPAWN_ERROR_NOTDIR = 10, 58 G_SPAWN_ERROR_LOOP = 11, 59 G_SPAWN_ERROR_TXTBUSY = 12, 60 G_SPAWN_ERROR_IO = 13, 61 G_SPAWN_ERROR_NFILE = 14, 62 G_SPAWN_ERROR_MFILE = 15, 63 G_SPAWN_ERROR_INVAL = 16, 64 G_SPAWN_ERROR_ISDIR = 17, 65 G_SPAWN_ERROR_LIBBAD = 18, 66 G_SPAWN_ERROR_FAILED = 19 67 } 68 69 enum _Anonymous_1 70 { 71 G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1, 72 G_SPAWN_DO_NOT_REAP_CHILD = 2, 73 G_SPAWN_SEARCH_PATH = 4, 74 G_SPAWN_STDOUT_TO_DEV_NULL = 8, 75 G_SPAWN_STDERR_TO_DEV_NULL = 16, 76 G_SPAWN_CHILD_INHERITS_STDIN = 32, 77 G_SPAWN_FILE_AND_ARGV_ZERO = 64 78 } 79 80 version(Derelict_Link_Static) 81 { 82 extern( C ) nothrow 83 { 84 GQuark g_spawn_error_quark(); 85 GQuark g_spawn_exit_error_quark(); 86 gboolean g_spawn_async(const(gchar)* working_directory, gchar** argv, gchar** envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, GPid* child_pid, GError** error); 87 gboolean g_spawn_async_with_pipes(const(gchar)* working_directory, gchar** argv, gchar** envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, GPid* child_pid, gint* standard_input, gint* standard_output, gint* standard_error, GError** error); 88 gboolean g_spawn_sync(const(gchar)* working_directory, gchar** argv, gchar** envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, gchar** standard_output, gchar** standard_error, gint* exit_status, GError** error); 89 gboolean g_spawn_command_line_sync(const(gchar)* command_line, gchar** standard_output, gchar** standard_error, gint* exit_status, GError** error); 90 gboolean g_spawn_command_line_async(const(gchar)* command_line, GError** error); 91 gboolean g_spawn_check_exit_status(gint exit_status, GError **error); 92 void g_spawn_close_pid(GPid pid); 93 } 94 } 95 else 96 { 97 extern( C ) nothrow 98 { 99 alias da_g_spawn_error_quark = GQuark function(); 100 alias da_g_spawn_exit_error_quark = GQuark function(); 101 alias da_g_spawn_async = gboolean function(const(gchar)* working_directory, gchar** argv, gchar** envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, GPid* child_pid, GError** error); 102 alias da_g_spawn_async_with_pipes = gboolean function(const(gchar)* working_directory, gchar** argv, gchar** envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, GPid* child_pid, gint* standard_input, gint* standard_output, gint* standard_error, GError** error); 103 alias da_g_spawn_sync = gboolean function(const(gchar)* working_directory, gchar** argv, gchar** envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, gchar** standard_output, gchar** standard_error, gint* exit_status, GError** error); 104 alias da_g_spawn_command_line_sync = gboolean function(const(gchar)* command_line, gchar** standard_output, gchar** standard_error, gint* exit_status, GError** error); 105 alias da_g_spawn_command_line_async = gboolean function(const(gchar)* command_line, GError** error); 106 alias da_g_spawn_check_exit_status = gboolean function(gint exit_status, GError **error); 107 alias da_g_spawn_close_pid = void function(GPid pid); 108 } 109 110 __gshared 111 { 112 da_g_spawn_error_quark g_spawn_error_quark; 113 da_g_spawn_exit_error_quark g_spawn_exit_error_quark; 114 da_g_spawn_async g_spawn_async; 115 da_g_spawn_async_with_pipes g_spawn_async_with_pipes; 116 da_g_spawn_sync g_spawn_sync; 117 da_g_spawn_command_line_sync g_spawn_command_line_sync; 118 da_g_spawn_command_line_async g_spawn_command_line_async; 119 da_g_spawn_check_exit_status g_spawn_check_exit_status; 120 da_g_spawn_close_pid g_spawn_close_pid; 121 } 122 }